﻿using Simulation.Framework;
using System.Collections;
using UnityEngine;

namespace Easy.Game2d
{
    public class StepBossManager : StepBase
    {

        #region override
        public override void Init()
        {

        }

        public override void Clear()
        {
        }




        public override void Start()
        {
            InitStep();

        }


        public override void Stop()
        {

        }

        #endregion

        #region boss
        private Transform levelMonster;
        private BossItem bossItem;
        private PlayerController player;
        #endregion

        #region logic

        private void InitStep()
        {
            player = GameObject.FindObjectOfType<PlayerController>();


            Transform levMonster = SingleBehavior<ResManagerByResources>.getInstance().Load<Transform>("Models/LevelBoss");
            levelMonster = UnityEngine.GameObject.Instantiate(levMonster);

            BossItem bossMonster = SingleBehavior<ResManagerByResources>.getInstance().Load<BossItem>("Models/Boss");
            bossItem = UnityEngine.GameObject.Instantiate(bossMonster);
            bossItem.StartCor(player.transform, 150, SetDialogue);

        }
        #endregion
        #region ui

        private void SetDialogue()
        {
            UIDialoguePanel dialoguePanel = SingleBehavior<PanelManager>.getInstance().Open<UIDialoguePanel>(PanelName._dialoguePanel);
            dialoguePanel.DialogueStep03(delegate { SingleBehavior<PanelManager>.getInstance().Open<UISetPanel>(PanelName._setPanel); });
        }

        #endregion
    }
}